<?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author  Tran Van Thanh
 * @email   thanhtran@vietnambiz.com
 * @date    30.08.2011
 */
 
class Product_type_model extends MY_Model {
    
    function __construct()
    {
        parent::__construct();
        $this->_table = 'product_type';
    }
    
    function get_product_type($page = 1)
    {
    	$limit = $this->config->item('product_type', 'limit');
    	return $this->limit($limit, ($page - 1)*$limit)->get_all();
    }        

    function delete_product_type($product_type_id)
    {     
    	if(is_numeric($product_type_id)) {
        	$a[] = $product_type_id;
        	$product_type_id = $a;
        }
    	$this->db->where_in('id', $product_type_id)->delete('product_type');    	
    	$this->delete_many($product_type_id);    	
    }
}